package cn.iocoder.yudao.module.reading.controller.app.plan.vo;

import cn.iocoder.yudao.module.reading.framework.vo.BaseUrlConvertVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 计划每日任务 Response VO
 *
 * @author 李晨
 */
@Schema(description = "用户 APP - 计划每日任务 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class PlanDailyTaskRespVO extends BaseUrlConvertVO {

    @Schema(description = "任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @Schema(description = "计划ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long planId;

    @Schema(description = "绘本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long bookId;

    @Schema(description = "绘本标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "小猪佩奇")
    private String bookTitle;

    @Schema(description = "绘本封面", example = "https://example.com/cover.jpg")
    private String bookCover;

    @Schema(description = "任务日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025-01-01")
    private LocalDate taskDate;

    @Schema(description = "任务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "read")
    private String taskType;

    @Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "pending")
    private String status;

    @Schema(description = "是否是复习任务", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
    private Boolean isReview;

    @Schema(description = "阅读时长（秒）", example = "300")
    private Integer readingTime;

    @Schema(description = "完成时间", example = "2025-01-01T10:00:00")
    private String completedTime;

    @Schema(description = "备注", example = "这本书很有趣")
    private String notes;

    /**
     * 转换URL字段
     * 将相对路径转换为完整URL
     */
    @Override
    public void convertUrls() {
        this.bookCover = convertUrl(this.bookCover);
    }

}
